﻿ @using MvcPaging
 @model MvcPaging.IPagedList<TuanAnhPersonalWeb.Models.aspnet_Roles>
 <table>
        <tr>
            <th></th>
 
            <th>
                Role Name
            </th>
            
            <th>
                Description
            </th>
        </tr>
    @if (Model.Count > 0)
       { 
  foreach (var item in Model)
       {
    
        <tr>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.RoleId }) |
                @Html.ActionLink("Details", "Details", new { id = item.RoleId })                 
            </td>  
            <td>
                @item.RoleName
            </td>           
            <td>
                @item.Description
            </td>
        </tr>    
     } 
     } 
     else
        { 
        <tr>
            <td colspan="3" align="center">No data to display</td>
        </tr>
     } 
    </table>

         <div class="pager">
  @Ajax.Pager(ViewData.Model.PageSize, ViewData.Model.PageNumber, ViewData.Model.TotalItemCount, new { controller = "Roles", action = "Search", valSearch = ViewData["valSearch"] }, new AjaxOptions { UpdateTargetId = "divGrid", OnBegin = "beginPaging", OnSuccess = "successPaging" })
 </div>